﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Data.Objects;
using JChatCore.User;
namespace JChatData.UserMap
{
   public class UserMap:EntityConfiguration<User>
    {
       /// <summary>
       /// Mapping to entity
       /// Code by Linh Pham
       /// </summary>
       public UserMap()
       {
           HasKey(c => c.UserID);
           Property(c => c.UserID);
           Property(c => c.UserGuid);
           Property(c => c.RealName).IsRequired();
           Property(c => c.UserName).IsRequired();
           Property(c => c.Password).IsRequired();
           Property(c => c.PasswordTemp);
           Property(c => c.Email).IsRequired();
           Property(c => c.Address);
           Property(c => c.CityID);
           Property(c => c.CountryID);
           Property(c => c.Status);
           Property(c => c.Sex).IsRequired();
           Property(c => c.BirthDay);
           Property(c => c.Avatar);
           Property(c => c.CreateDate);
           Property(c => c.LastLoginDate);
           Property(c => c.LastActivityDate);
           Property(c => c.OtherInfo);
           Property(c => c.Active);
       }
    }
}
